export default {
  namespaced: true,
  state: {
    list: [
      {name:'吃饭', value:true},
      {name:'睡觉', value:false},
      {name:'打豆豆', value:true}
    ],
    list1: [
      {name:'吃饭', value:true},
      {name:'睡觉', value:false},
      {name:'打豆豆', value:true}
    ],
    gal: 'all'
  },
  mutations: {
    addList(state, list) {
      state.list1.push(list)
    },
    delList(state, index) { 
      state.list1.splice(index, 1)
    },
    remainList(state) {
      state.list1 = state.list.filter(item => item.value !== true)
      state.gal = 'no'
    },
    finishList(state) {
      state.list1 = state.list.filter(item => item.value !== false)
      state.gal = 'yes'
    },
    fulfillList(state) {
      state.list = state.list.filter(item => item.value !== true)
      state.list1 = state.list
      if(state.gal === 'yes') {
        state.list1 = state.list.filter(item => item.value !== false)
      }
    }
  },
  actions: {
  }
}